package com.tg.loginex.helper;

import androidx.annotation.NonNull;
import androidx.core.util.Consumer;

import com.appbase.custom.BuildConfig;
import com.appbase.custom.constant.CommonConstants;
import com.tange.base.toolkit.PreferenceUtil;
import com.tange.core.backend.service.http.ClientObserver;
import com.tange.core.builtin.account.VerificationCode;
import com.tange.core.data.structure.Ret;
import com.tg.appcommon.android.TGApplicationBase;
import com.tg.data.http.entity.EmptyBean;
import com.tg.network.socket.http.TGHttp;

import java.util.HashMap;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class LoginVerify {
    public static void verify(final String account, final String verifyCode, String scene, @NonNull final LoginHelper.LoginListener<String> loginListener) {
        VerificationCode verificationCode = new VerificationCode();
        verificationCode.verify(account, scene, verifyCode, ret -> {
            if (ret.getSuccess()) {
                loginListener.onSuccess(ret.getMessage());
            } else {
                loginListener.onError(ret.getCode(), ret.getMessage());
            }
            loginListener.onFinish();
        });
    }
}
